<?php
	class SessionHandler {
		protected $savePath;
		protected $sessionName;
		
		public function __construct() {
			session_set_save_handler(array($this, "open"), array($this, "close"), array($this, "read"), array($this, "write"), array($this, "destroy"), array($this, "gc"));
		}

		public function open($savePath, $sessionName) {
			$this -> savePath = $savePath;
			$this -> sessionName = $sessionName;

			return true;
		}

		public function close() {
			// 关闭session逻辑
			return true;
		}

		public function read($id) {
			// 读取session逻辑
			return "session value of $id readed from storage";
		}

		public function write($id, $data) {
			// 写入session逻辑
			return true;
		}

		public function destroy($id) {
			// 销毁session逻辑
			return true;
		}

		public function gc($maxlifetime) {
			// 回收session逻辑
			return true;
		}

	}
?>